<template>
	<view class="welfare_detail_page">
		<navgatsmyVue></navgatsmyVue>
		<view class="main">
			<view class="title">
				<view class="img" :style="{ backgroundImage: 'url(' + boxdetail.cover + ')' }"></view>
				<view class="name">
					{{boxdetail.name}}
				</view>
			</view>
			<view class="list_box">
				<view class="title">
					包含物品
				</view>
				<view class="boxc">
					<view class="scroll_boxc">
						<view class="item" v-for="(item,index) in boxdetail.contains" :key="index">
							<view class="img" :style="{ backgroundImage: 'url(' + item.skins.cover + ')' }"></view>
							<view class="name">{{item.skins.name}}</view>
							<view class="odds">概率:{{item.odds_percent}}</view>
							<view class="price">价格:{{item.skins.bean}}元</view>
						</view>
					</view>
				</view>
			</view>
			<view class="btn">
				点击领取
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	import navgatsmyVue from '../../../../Component/navgatsmy/navgatsmy.vue';
	import {
		getBoxDetail_det
	} from '../../../../api/outOfTheFree/index.js';
	export default {
		data() {
			return {
				boxId: "",
				boxdetail: {}
			}
		},
		components: {
			navgatsmyVue
		},
		onLoad(options) {
			this.boxId = options.boxId
			this.$nextTick(() => {
				this.getDetail()
			})
		},
		methods: {
			async getDetail() {
				let res = await getBoxDetail_det(this.boxId)
				this.boxdetail = res.data
				console.log(this.boxdetail);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.welfare_detail_page {
		width: 100vw;
		height: 100vh;

		.main {
			width: 100%;
			height: calc(100% - 90rpx);
			display: flex;
			flex-direction: column;
			align-items: center;
			background-image: url("https://img.jingkakeji.com/img/static/new_index/bg.png");
			background-size: 100% 100%;

			>.title {
				width: 90%;
				height: 250rpx;
				margin-top: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.img {
					width: 200rpx;
					height: 200rpx;
					background-size: contain;
					background-position: center;
					background-repeat: no-repeat;
					background-color: #959595;
					border-radius: 20rpx;
				}

				.name {
					width: calc(100% - 250rpx);
					font-size: 26rpx;
					color: #959595;
				}
			}

			.list_box {
				width: 90%;
				height: 380rpx;

				.title {
					width: 100%;
					height: 80rpx;
					line-height: 80rpx;
					color: #959595;
				}

				.boxc {
					width: 100%;
					height: 300rpx;
					overflow-y: scroll;

					.scroll_boxc {
						width: auto;
						height: 100%;
						display: flex;

						.item {
							min-width: 300rpx;
							height: 300rpx;
							background-color: #717171;
							border-radius: 10rpx;
							display: flex;
							flex-direction: column;
							align-items: center;
							justify-content: space-evenly;

							.img {
								width: 200rpx;
								height: 100rpx;
								background-size: contain;
								background-position: center;
								background-repeat: no-repeat;
							}

							.name {
								color: white;
								font-size: 26rpx;
							}

							.odds {
								font-size: 24rpx;
								color: #ccc;
							}

							.price {
								font-size: 24rpx;
								color: #FBDC3B;
							}
						}

						.item:not(:first-child) {
							margin-left: 20rpx;
						}
					}
				}
			}

			.btn {
				width: 90%;
				height: 100rpx;
				background-color: #F44336;
				margin-top: 50rpx;
				border-radius: 20rpx;
				text-align: center;
				line-height: 100rpx;
				color: white;
				font-size: 26rpx;
			}
		}
	}
</style>